• The creator of Ruby on Rails, David Heinemeier Hansson, realized that the success of the framework was not due to his attempts to convince others, but rather by showcasing its capabilities and letting others decide for themselves. He now believes in respecting the various preferences of programmers and encouraging them to find the language that best suits their individual style and needs.

    Tuesday, June 4, 2024
  • Ruby on Rails has long been a defining framework in the web development community, inspiring attempts to replicate its success in various programming languages. While some frameworks like Laravel, ASP.NET, and Phoenix have found success, many others in languages such as Java, Kotlin, Scala, Node.js, Go, and Rust have struggled to achieve widespread adoption. The key to Ruby on Rails' success lies in its creator's strong opinions, which were translated into conventions that simplified the development process. This approach stood in stark contrast to the more configuration-heavy frameworks of the early 2000s. A common issue with many Rails-like frameworks is the lack of decisive conventions. Framework creators often adopt a non-committal stance, leaving choices up to individual developers. This can hinder the framework's usability, as developers are often overwhelmed by the need to make numerous decisions before they can begin working. Strong opinions and clear conventions are essential for a framework to be user-friendly and to facilitate rapid development. One significant area for improvement in modern frameworks is the handling of primary keys in databases. Traditionally, auto-incrementing primary keys have been the default, but this practice can expose sensitive information. Instead, using universally unique identifiers (UUIDs) is recommended, as they provide better security and scalability options. The framework should adopt a clear stance on this issue, ensuring that the public API uses identifiers that are safe to share. In addition to database design, a modern Rails-like framework should prioritize an API-first approach. Given the diverse range of front-end technologies available today, from mobile apps to IoT devices, a robust API is essential. While various protocols exist, RESTful APIs remain the most universally supported, making them a practical choice for a framework's foundation. To complement the API-first strategy, the framework should also implement a solid API specification, such as OpenAPI. This would facilitate the generation of high-quality documentation and improve the overall developer experience. By automatically creating an OpenAPI specification from the code, the framework can enhance integration capabilities and streamline third-party interactions. Another innovative idea is to decouple models from the database by generating them from upstream APIs. This would alleviate the common pain point of third-party integrations, allowing developers to easily compose applications and leverage existing APIs. Improved tooling for API code generation is also necessary to ensure high-quality output. The structure of the framework's codebase is another critical consideration. A feature-first structure, where controllers, models, and views are organized by feature rather than by layer, can help prevent accidental coupling and make the codebase easier to manage as it grows. This approach aligns with domain-driven design principles and encourages developers to focus on local solutions without prematurely generalizing their code. Ultimately, for a Rails-like framework to succeed, it must evolve beyond simply replicating Ruby on Rails conventions. The landscape of application development has changed significantly since 2003, and new conventions must be established to facilitate rapid development while avoiding common pitfalls. By making decisive choices and prioritizing developer experience, a modern framework can carve out its niche in the competitive landscape of web development.